class FeedbackController < ApplicationController
  skip_before_filter :require_login

  def index

  end

  def send_message

    email = params[:email_fb]
    title = params[:title_fb]
    content = params[:content_fb]

    if verify_recaptcha :private_key => '6LeKIt8SAAAAAIB-tEiNeGS-NYmXSGyZxucuXvZk'
      begin
        Feedback.create({:title => title, :email => email, :content => content, :handled => false, :send_day => Time.now})
      rescue
        flash[:message] = 'Feedback failed!'
      else
        flash[:message] = 'Feedback Successfully!'
      end
    else
      flash[:message] = 'Wrong captcha!'
    end

    redirect_to :action => 'index'
  end
end
